# -*- coding:utf-8 -*-
# 北梦测教育
# 课程咨询加微信：xiaobeiceshi
from Crypto.PublicKey import RSA
from Crypto.Cipher import AES, PKCS1_v1_5
import base64
import struct
import json


def load_private_key(privateKeyStr):
    """
    从字符串加载私钥
    :param privateKeyStr:私钥字符串
    :return:私钥
    """
    b64_privateKeyStr = base64.b64decode(privateKeyStr)
    private_key = RSA.import_key(b64_privateKeyStr)
    return private_key


def decrypt(encryptedDataStr, privateKey):
    """
    使用私钥解密
    :param encryptedDataStr:接口返回的加密字符串
    :param privateKey:私钥
    :return:解密之后的数据
    """
    # 步骤1：Base64解码
    data = base64.b64decode(encryptedDataStr)

    # 步骤2：读取AES密钥长度（4字节）
    # >：大端序，顺序存储
    # 0x12345678
    # 12 34 56 78
    # I:无符号整型
    key_len = struct.unpack(">I",data[:4])[0]

    # 步骤3
    # 提取加密的AES的密钥和数据
    # 根据前面获得的key_len来分割出加密的AES密钥和实际加密的数据内容
    encrypted_aes_key = data[4:4+key_len]
    encrypted_content = data[4+key_len:]

    # 步骤4：使用RAS解密AES密钥
    cipher_rsa = PKCS1_v1_5.new(privateKey)
    decrypted_aes_key = cipher_rsa.decrypt(encrypted_aes_key,None)

    # 步骤5：使用AES解密
    # AES也有很多加密模式，模式使用ECB
    cipher_aes = AES.new(decrypted_aes_key,AES.MODE_ECB)
    decrypted_content = cipher_aes.decrypt(encrypted_content)

    # 步骤6：解决返回值里面的中文编码问题
    # print(decrypted_content)
    pad_len = decrypted_content[-1]
    res_content = decrypted_content[:-pad_len].decode("utf-8")

    return res_content


def crypto_decrypt(priKey_str,encrypted_data):
    """
    解密的最终调用的函数
    """
    privateKey = load_private_key(priKey_str)
    decrypted = decrypt(encrypted_data, privateKey)
    decrypted = json.loads(decrypted)   # 返回的数据是字符串，转成字典
    return decrypted



if __name__ == '__main__':
    # # 私钥
    priKeyStr = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCCdohWKOA7Bhx9+c3uOP9OyT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PoN2j9pcSlxirakDpKEAldSvGw8dUGdrCHaSIwbxTrnTV85NtQbPi3/RpN7CNbE2jMpvmNkmKpdKaAwedekrkrogNEOBEvDYYmTeiteAbzcCGNb5WtNQClFAoGAQzpG/hwHa16bmNiLg4kcfrTDnWbankwUYeqDtO/0gL4EZByfLctM2NWaH6D/9mYu8hDnqlbFcnBJ/130KihhG0jP599HR3Ib1f1FqoXhr+Bc9bEGQ6l8h2VEAzTdwrXK2JMvGfJ4nm23/tgYCwnbwGmzuWeGmSunz31jzxMiyuUCgYAcTQ9V3WZilNF7VYAXCghxI65Bstpv9vPlcXdR6IZSe5vUT9PMdgwx1zjcUdwiYBCW52u6fd9WNL32fF4ouJbNEWu2xFoxLXlNj9SF0kvBGruLFD+qzQeGJx46++tctsII6QIRJf3JFyrovLJtJ63b0eTg0DU9Uuc6DsoOjqh5Fg=="
    # privateKey = loadPrivateKey(priKeyStr)
    # print(privateKey)
    #
    # # 加密的字符串--返回值
    encryptedData = "AAABAE7xxlh5JhHyrg4tDg7K4MfstCn+/IulCNu+XmBB1KIUZvRpHgos14f5XN/waehDuj0dekVxfC3iwKXXeVUyW9mqJLv2slTCSl4F4ddheuINspgU+KsPwDpyk8iZJEMd4MqAEdNF/24Cz1PKa/ehJJ5kVfzV1Sj+CA0r4Gf5LGeR/6BvNYO42SdrJxiuB9hlC6tzIxNy1A+15EB9rYZcWtWgF7tWHb4YinGYqaOqJ8ZhTjZnhUEH8/6jA/Ey4+AkcPgX5PQpr8VyEMLFF92xnXil8UJYY6VqEuZJ8fo1sdIfU0OuAy1nj+tpY9ua1Pxfld3oxDvYSl0lsQG+AU2IaZRUsN8Fh2imHwHpyt19HNCszec4Au9lKUXmtHiUjHhBlA3qsg6S2TiSjlTX3t0M3Vxv+YxlWROMTy1nvShsLc1mQin8TUMJ0DejjaWB4DmsqqBYcwWh9j60ttfGmkIikgb5tiHdTW36jm7pFKgp9nhupBiXlNlXptyd+8qQjrILGUS8QXMBMlPp8QzeEPbSpR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5cBBsgdhy81/Trr9GGy1uz+PMz6wTogsLiIMPjisW/pahTECdgnxxVP1MWAtHcHubTgRjDwFrcxebG5967ABh11NEKqsqtgwRgB1KJ/rcjfE0avGnnCvktGxrFtt2ayB5ntOMvj8Mo+R4FAJloknn+Alp21Ru8rJLAz8PGrbDXkf0rm4ugH1GhiVpM1pxrZg26NDZSnYA9LwGMFgs2CsqxLDGit7PS6ZoZR5c58fC3Ig8AATQQ+kY/36GXZAMasmiylQJi8sq8rGOrBMN5+1/85+ybAFw2iuDSysy1ZQIIZXlh3gu7538daQSiYYSBZ9TMdGCu3WkQ4MnnNmAnpdknYjHg7SxoJO+LaXFmmUS2FVApYyiRwQPjqjEYlzJF5frU1jPaQonYWaIlkmAzGyBww2Gcav4/vm48v1Z1VEV1YK+tObfOTRaRrXZQt3xRpaKzQhNh3RWx/I6ixDPuMhdGCrA2INin9Bt2vL88m0jSUJRt3HrbzSmkwQujb6nJcF+FuDyLQaLZ9nl2pTaSJa+43BoWJIBp77BANvyYPvRtqyPmKoSwcA4wOolQx9lXS7fPJH7QmOWhtyTklUh7gfjghc40bLhYvtRfD6cKcy1yHtiAHMPrMglXjyjxIk9daE+jL5nf/QqMF8DEwwEYyMr2JXZ+VD0y0JyvV+7imazeHhByKa79xMW7s7YR6OX2eFMWb69A3Fz3+ifUgJnI1+GliZWU7DpLP7bGveFFCP+RWyz1eng8+ht97h+00pPI5vpzvfeJKlGMbMphBCVg6wUUmL/W0G/Qb9lAiypYVcI+w0xwuhOjZNBvbaHpYyk2RtiUM3HHImI0Py9tD67N/MI+jScNFOxE39wrCaQI5wpmko/HIZibAzqPutrBCoSDCA7XVJHMHBcXdb8DPvWEozq45i7g5OXJ4Ac7ANkNolARWpl2NYVt7CgcEdyAdPct/vmzg3Cl4IGJMFP0WSf3iO7ToLVzMzaDHmZttjUrYATWJ"
    # decrypted = decrypt(encryptedData, privateKey)
    # print("解密结果：", decrypted)

    print(crypto_decrypt(priKeyStr, encryptedData))
